#pragma once

#include<vector>

#include"Unit.h"
#include"Location.h"

using std::vector;

void GetGroupMass(const vector<Custom::Unit>& units , Location& mass)
{
	mass.X = 0;
	mass.Y = 0;
	for(int whichUnit = 0 ; whichUnit < units.size() ; ++whichUnit)
	{
		mass.X += units[whichUnit].GetX();
		mass.Y += units[whichUnit].GetY();
	}
	mass.X /= (float)units.size();
	mass.Y /= (float)units.size();
}